#ifndef OLLAMAFETCHER_H
#define OLLAMAFETCHER_H

#include <QObject>

class QNetworkReply;
class QNetworkAccessManager;
class OllamaFetcher : public QObject
{
    Q_OBJECT
public:
    explicit OllamaFetcher(QObject *parent = nullptr);

    void setSyncMode(bool sync);

signals:
//    void onFetched(bool success, QObject)
//    void onFetched(QNetworkReply *reply);
//    void onFetchFail(QNetworkReply *reply);

private slots:
    void onRequestFinished(QNetworkReply *reply);

private:
    QNetworkAccessManager *httpManager;
    bool isSync;

protected:
    virtual void fetchFinished(bool success, QNetworkReply *reply) = 0;
};

#endif // OLLAMAFETCHER_H
